package demo5_p;

public class Test {

    public void func1(Animal animal){

    }
    public Animal func2(){
        Dog dog = new Dog("旺财", 10);
        return dog;
    }
    public static void main1(String[] args) {
        //向上转型
        Dog dog = new Dog("旺财", 10);
        Animal animal = dog;
        animal.eat();
        //animal.bark();
        //Aniamal animal = new Dog("旺财", 10);
    }

    public static void main(String[] args) {

    }
}
